package com.qr.service.Impl;

import com.qr.dao.BookMapper;
import com.qr.pojo.Books;
import com.qr.service.BookService;

import java.util.List;

/**
 * @author 龚倾茹
 * @date 2021/8/14 - 10:49
 */

public class BookServiceImpl implements BookService {
    //service调dao层：组合dao

    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }

    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }
  public Books findBookByName(String bookName){return bookMapper.findBookByName(bookName);}
    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }
}
